package com.etone;

import java.util.HashSet;

public class Unit {

	private String name;
	
	public Unit(String name) {
		this.name = name;
	}
	public int hashCode() {
		return name.hashCode();
	}

	@Override
	public boolean equals(Object obj) {
		return this.name == ((Unit)obj).name; 
	}
	public static void main(String[] args) {
		HashSet<Unit> test = new HashSet<Unit>();
		test.add(new Unit("a"));
		test.add(new Unit("a"));
		
		System.out.println(test.contains(new Unit("a")));
		
		
		
	}
}
